package com.example.consumer.listener;

import com.alibaba.fastjson.JSON;
import com.example.common.entity.MsgTest;
import com.example.rocket.annotation.NbMQMessageListener;
import com.example.rocket.consumer.NbMqListener;
import com.example.rocket.core.NbMsg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@NbMQMessageListener(topic = "first-topic-nb-pojo",consumerGroup = "nb-pojo-consumer")
public class PojoListener implements NbMqListener<MsgTest> {

    @Override
    public void onMessage(MsgTest message) {
        log.info("成功接受到消息===>{}", JSON.toJSONString(message));
    }
}
